﻿using Yarp.ReverseProxy.Configuration;

namespace ProxyServer.Yarp;

public static class Extensions
{
    public static IReverseProxyBuilder LoadFromApp(this IReverseProxyBuilder builder) 
    {
        builder.Services.AddSingleton<AppProxyConfigProvider>();
        builder.Services.AddSingleton<IProxyConfigProvider>(sp => sp.GetRequiredService<AppProxyConfigProvider>());
        return builder;
    }
}
